#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void swap(int* pl, int left, int right)
{
	while (left < right)
	{
		if (pl[left] % 2 != 0)
		{
			left++;
		}
		if (pl[right] % 2 == 0)
		{
			right--;
		}
		if ((pl[left] % 2 == 0) && (pl[right] % 2 != 0))
		{
			int temp = pl[left];
			pl[left] = pl[right];
			pl[right] = temp;
		}
	}
}
//int main()
//{
//	int arr[] = { 2,43,2546,657,45,54,5435 };
//	int right = sizeof(arr) / sizeof(arr[0]) - 1;
//	int left = 0;
//	swap(arr,left,right);
//	for (int i = 0; i < right + 1; i++)
//	{
//		printf("%d ", arr[i]);
//	}
//	return 0;
//}
void Print_arr(int* p, int len)
{
	for (int i = 0; i < len; i++)
	{
		printf("%d ", *(p + i));
	}
	printf("\n");
}



void maopao(int* p, int len)
{
	for (int i = 0; i < len - 1; i++)
	{
		int flag = 0;
		for (int j = 0; j < len - 1 - i; j++)
		{
			if (p[j] > p[j + 1])
			{
				int temp = p[j];
				p[j] = p[j + 1];
				p[j + 1] = temp;
				flag = 1;
			}
		}
		if (flag == 0)
			break;
	}
}

int main()
{
	int arr[] = {32,14,435,535,24,543,6,7647,634};
	int sz = sizeof(arr) / sizeof(arr[0]);
	
	Print_arr(arr, sz);
	maopao(arr, sz);
	Print_arr(arr, sz);
	return 0;
}